/*
 * Copyright (c) 2021, 2023 Oracle and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.helidon.examples.integrations.vault.hcp;

final class VaultPolicy {
    private VaultPolicy() {
    }
    static final String POLICY = """
            # Enable and manage authentication methods
            path "auth/*"
            {
              capabilities = ["create", "update", "delete", "sudo"]
            }

            # Create, update, and delete auth methods
            path "sys/auth/*"
            {
              capabilities = ["create", "update", "delete", "sudo"]
            }

            # List auth methods
            path "sys/auth"
            {
              capabilities = ["read"]
            }

            # Enable and manage the key/value secrets engine at `secret/` path

            # List, create, update, and delete key/value secrets
            path "secret/*"
            {
              capabilities = ["create", "read", "update", "delete", "list", "sudo"]
            }

            path "kv1/*"
            {
              capabilities = ["create", "read", "update", "delete", "list", "sudo"]
            }

            path "cubbyhole/*"
            {
              capabilities = ["create", "read", "update", "delete", "list", "sudo"]
            }

            path "database/*"
            {
              capabilities = ["create", "read", "update", "delete", "list", "sudo"]
            }

            path "kv/*"
            {
              capabilities = ["create", "read", "update", "delete", "list", "sudo"]
            }

            # Manage secrets engines
            path "sys/mounts/*"
            {
              capabilities = ["create", "read", "update", "delete", "list", "sudo"]
            }

            # List existing secrets engines.
            path "sys/mounts"
            {
              capabilities = ["read"]
            }
            """;
}
